home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume10 / sun.serpatch / part02 < prev    next >
Encoding:
Internet Message Format  |  1990-10-25  |  39.2 KB

  1. Path: uunet!know!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!lll-winken!sun-barr!newstop!sun!langue.is.tsukuba.ac.jp
  2. From: ntakahas@langue.is.tsukuba.ac.jp (TAKAHASHI Naoto)
  3. Newsgroups: comp.sources.x
  4. Subject: v10i024: Xsun for CG8/CG9, Part02/02
  5. Message-ID: <144196@sun.Eng.Sun.COM>
  6. Date: 25 Oct 90 17:58:27 GMT
  7. References: <csx-10i023:sun.serpatch@uunet.UU.NET>
  8. Sender: news@sun.Eng.Sun.COM
  9. Lines: 1422
  10. Approved: argv@sun.com
  11.  
  12. Submitted-by: ntakahas@langue.is.tsukuba.ac.jp (TAKAHASHI Naoto)
  13. Posting-number: Volume 10, Issue 24
  14. Archive-name: sun.serpatch/part02
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then unpack
  18. # it by saving it into a file and typing "sh file".  To overwrite existing
  19. # files, type "sh file -c".  You can also feed this as standard input via
  20. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  21. # will see the following message at the end:
  22. #        "End of shell archive."
  23. # Contents:  cg8.diff
  24. # Wrapped by ntakahas@langue on Thu Oct  4 07:19:58 1990
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. if test -f 'cg8.diff' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'cg8.diff'\"
  28. else
  29. echo shar: Extracting \"'cg8.diff'\" \(37110 characters\)
  30. sed "s/^X//" >'cg8.diff' <<'END_OF_FILE'
  31. Xdiff -arcN server/Imakefile cg8/Imakefile
  32. X*** server/Imakefile    Mon Sep 17 01:47:34 1990
  33. X--- cg8/Imakefile    Mon Sep 17 01:46:44 1990
  34. X***************
  35. X*** 240,246 ****
  36. X  SUNDIRS = dix ddx/snf ddx/mi ddx/mfb ddx/cfb ddx/sun os/4.2bsd
  37. X  SUNOBJS = ddx/sun/sunInit.o $(FONTUTIL)
  38. X  SUNLIBS = $(SUN) $(CFB) $(DIX) $(BSD) $(SNF) $(MFB) $(MI) $(EXTENSIONS)
  39. X! SUNSYSLIBS = $(SYSLIBS) $(SUNWINDOWSLIBS)
  40. X  XsunDIRS = $(SUNDIRS)
  41. X  
  42. X  ServerTarget(Xsun,$(EXTDIR) $(FONTUTILDIR) $(SUNDIRS),$(SUNOBJS),$(SUNLIBS),$(SUNSYSLIBS))
  43. X--- 240,246 ----
  44. X  SUNDIRS = dix ddx/snf ddx/mi ddx/mfb ddx/cfb ddx/sun os/4.2bsd
  45. X  SUNOBJS = ddx/sun/sunInit.o $(FONTUTIL)
  46. X  SUNLIBS = $(SUN) $(CFB) $(DIX) $(BSD) $(SNF) $(MFB) $(MI) $(EXTENSIONS)
  47. X! SUNSYSLIBS = $(SYSLIBS) $(SUNWINDOWSLIBS) -lpixrect
  48. X  XsunDIRS = $(SUNDIRS)
  49. X  
  50. X  ServerTarget(Xsun,$(EXTDIR) $(FONTUTILDIR) $(SUNDIRS),$(SUNOBJS),$(SUNLIBS),$(SUNSYSLIBS))
  51. Xdiff -arcN server/ddx/cfb/Imakefile cg8/ddx/cfb/Imakefile
  52. X*** server/ddx/cfb/Imakefile    Sun Sep 16 23:36:26 1990
  53. X--- cg8/ddx/cfb/Imakefile    Sun Sep 16 23:45:17 1990
  54. X***************
  55. X*** 4,13 ****
  56. X       cfbpntwin.c cfbmskbits.c cfbpixmap.c cfbbitblt.c \
  57. X       cfbfillsp.c cfbsetsp.c cfbscrinit.c \
  58. X       cfbgetsp.c cfbfillrct.c cfbtileodd.c \
  59. X!      cfbcmap.c cfbzerarc.c cfbfillarc.c \
  60. X       cfbtegblt.c cfbbstore.c \
  61. X!      cfb8bit.c cfbteblt8.c cfbglblt8.c \
  62. X!       cfbpush8.c cfbrctstp8.c cfbpolypnt.c \
  63. X       cfbbres.c cfbline.c cfbhrzvert.c cfbbresd.c cfbimage.c
  64. X  
  65. X  OBJS =   cfbgc.o cfbwindow.o \
  66. X--- 4,12 ----
  67. X       cfbpntwin.c cfbmskbits.c cfbpixmap.c cfbbitblt.c \
  68. X       cfbfillsp.c cfbsetsp.c cfbscrinit.c \
  69. X       cfbgetsp.c cfbfillrct.c cfbtileodd.c \
  70. X!      cfbcmap.c cfbfillarc.c \
  71. X       cfbtegblt.c cfbbstore.c \
  72. X!       cfbpolypnt.c \
  73. X       cfbbres.c cfbline.c cfbhrzvert.c cfbbresd.c cfbimage.c
  74. X  
  75. X  OBJS =   cfbgc.o cfbwindow.o \
  76. X***************
  77. X*** 14,23 ****
  78. X       cfbgetsp.o cfbfillrct.o cfbtileodd.o \
  79. X       cfbfillsp.o cfbsetsp.o cfbscrinit.o \
  80. X       cfbpntwin.o cfbmskbits.o cfbpixmap.o cfbbitblt.o \
  81. X!      cfbcmap.o cfbzerarc.o cfbfillarc.o \
  82. X       cfbtegblt.o cfbbstore.o \
  83. X!      cfb8bit.o cfbteblt8.o cfbglblt8.o \
  84. X!       cfbpush8.o cfbrctstp8.o cfbpolypnt.o \
  85. X       cfbbres.o cfbline.o cfbhrzvert.o cfbbresd.o cfbimage.o cfbseg.o
  86. X  
  87. X     INCLUDES = -I. -I../mfb -I../mi -I../../include -I$(INCLUDESRC)
  88. X--- 13,21 ----
  89. X       cfbgetsp.o cfbfillrct.o cfbtileodd.o \
  90. X       cfbfillsp.o cfbsetsp.o cfbscrinit.o \
  91. X       cfbpntwin.o cfbmskbits.o cfbpixmap.o cfbbitblt.o \
  92. X!      cfbcmap.o cfbfillarc.o \
  93. X       cfbtegblt.o cfbbstore.o \
  94. X!       cfbpolypnt.o \
  95. X       cfbbres.o cfbline.o cfbhrzvert.o cfbbresd.o cfbimage.o cfbseg.o
  96. X  
  97. X     INCLUDES = -I. -I../mfb -I../mi -I../../include -I$(INCLUDESRC)
  98. Xdiff -arcN server/ddx/cfb/cfbbitblt.c cg8/ddx/cfb/cfbbitblt.c
  99. X*** server/ddx/cfb/cfbbitblt.c    Sun Sep 16 23:36:24 1990
  100. X--- cg8/ddx/cfb/cfbbitblt.c    Sun Sep 16 23:45:16 1990
  101. X***************
  102. X*** 35,40 ****
  103. X--- 35,45 ----
  104. X  #include    "cfb8bit.h"
  105. X  #include    "fastblt.h"
  106. X  
  107. X+ #ifdef sun
  108. X+ #include <pixrect/pixrect_hs.h>
  109. X+ Pixrect *sun_pr_screen;
  110. X+ #endif
  111. X+ 
  112. X  cfbDoBitblt(pSrc, pDst, alu, prgnDst, pptSrc, planemask)
  113. X      DrawablePtr        pSrc, pDst;
  114. X      int            alu;
  115. X***************
  116. X*** 216,221 ****
  117. X--- 221,248 ----
  118. X          xdir = 1;
  119. X      }
  120. X  
  121. X+ #ifdef sun
  122. X+     if ((pSrc->type == DRAWABLE_WINDOW)
  123. X+     && (pDst->type == DRAWABLE_WINDOW)
  124. X+     && (alu == GXcopy))
  125. X+     {
  126. X+     pr_putattributes(sun_pr_screen, &planemask);
  127. X+ 
  128. X+         while(nbox--)
  129. X+         {
  130. X+             pr_rop(sun_pr_screen,
  131. X+            pbox->x1, pbox->y1,
  132. X+            pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
  133. X+            PIX_SRC, sun_pr_screen,
  134. X+            pptSrc->x, pptSrc->y);
  135. X+             pbox++;
  136. X+             pptSrc++;
  137. X+         }
  138. X+         pr_get(sun_pr_screen, 0, 0);
  139. X+ 
  140. X+     } else
  141. X+ #endif
  142. X+ 
  143. X      /* special case copy */
  144. X      if (alu == GXcopy && (planemask & PMSK) == PMSK)
  145. X      {
  146. X***************
  147. X*** 942,947 ****
  148. X--- 969,976 ----
  149. X      return prgnExposed;
  150. X  }
  151. X  
  152. X+ static unsigned long    copyPlaneBitPlane;
  153. X+ 
  154. X  #if (PPW == 4)
  155. X  
  156. X  cfbCopyPlane1to8 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask)
  157. X***************
  158. X*** 1287,1294 ****
  159. X      }
  160. X  }
  161. X  
  162. X- static unsigned long    copyPlaneBitPlane;
  163. X- 
  164. X  #define mfbmaskbits(x, w, startmask, endmask, nlw) \
  165. X      startmask = starttab[(x)&0x1f]; \
  166. X      endmask = endtab[((x)+(w)) & 0x1f]; \
  167. X--- 1316,1321 ----
  168. X***************
  169. X*** 1317,1335 ****
  170. X      } \
  171. X  }
  172. X  
  173. X- cfbCopyImagePlane (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask)
  174. X-     DrawablePtr pSrcDrawable;
  175. X-     DrawablePtr pDstDrawable;
  176. X-     int    rop;
  177. X-     unsigned long planemask;
  178. X-     RegionPtr prgnDst;
  179. X-     DDXPointPtr pptSrc;
  180. X- {
  181. X-     copyPlaneBitPlane = planemask;
  182. X-     cfbCopyPlane8to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
  183. X-               (unsigned long) ~0L);
  184. X- }
  185. X- 
  186. X  cfbCopyPlane8to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask)
  187. X      DrawablePtr pSrcDrawable;
  188. X      DrawablePtr pDstDrawable;
  189. X--- 1344,1349 ----
  190. X***************
  191. X*** 1501,1506 ****
  192. X--- 1515,1751 ----
  193. X  
  194. X  #endif
  195. X  
  196. X+ #if (PPW == 1)
  197. X+ unsigned long cfb32Pixelsfg, cfb32Pixelsbg;
  198. X+ 
  199. X+ cfbCopyPlane1to32 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask)
  200. X+     DrawablePtr pSrcDrawable;
  201. X+     DrawablePtr pDstDrawable;
  202. X+     int    rop;
  203. X+     unsigned long planemask;
  204. X+     RegionPtr prgnDst;
  205. X+     DDXPointPtr pptSrc;
  206. X+ {
  207. X+     int    srcx, srcy, dstx, dsty, width, height;
  208. X+     int xoffSrc, xoffDst;
  209. X+     unsigned int *psrcBase, *pdstBase;
  210. X+     int    widthSrc, widthDst;
  211. X+     unsigned int *psrcLine, *pdstLine;
  212. X+     register unsigned int *psrc, *pdst;
  213. X+     register unsigned int bits, tmp;
  214. X+     register int leftShift, rightShift;
  215. X+     unsigned int startmask, endmask;
  216. X+     register int nl, nlMiddle;
  217. X+     int firstoff, secondoff;
  218. X+     int nbox;
  219. X+     BoxPtr  pbox;
  220. X+ 
  221. X+     if (pSrcDrawable->type == DRAWABLE_WINDOW)
  222. X+     {
  223. X+     psrcBase = (unsigned int *)
  224. X+         (((PixmapPtr)(pSrcDrawable->pScreen->devPrivate))->devPrivate.ptr);
  225. X+     widthSrc = (int)
  226. X+            ((PixmapPtr)(pSrcDrawable->pScreen->devPrivate))->devKind
  227. X+             >> 2;
  228. X+     }
  229. X+     else
  230. X+     {
  231. X+     psrcBase = (unsigned int *)(((PixmapPtr)pSrcDrawable)->devPrivate.ptr);
  232. X+     widthSrc = (int)(((PixmapPtr)pSrcDrawable)->devKind) >> 2;
  233. X+     }
  234. X+ 
  235. X+     if (pDstDrawable->type == DRAWABLE_WINDOW)
  236. X+     {
  237. X+     pdstBase = (unsigned int *)
  238. X+         (((PixmapPtr)(pDstDrawable->pScreen->devPrivate))->devPrivate.ptr);
  239. X+     widthDst = (int)
  240. X+            ((PixmapPtr)(pDstDrawable->pScreen->devPrivate))->devKind
  241. X+             >> 2;
  242. X+     }
  243. X+     else
  244. X+     {
  245. X+     pdstBase = (unsigned int *)(((PixmapPtr)pDstDrawable)->devPrivate.ptr);
  246. X+     widthDst = (int)(((PixmapPtr)pDstDrawable)->devKind) >> 2;
  247. X+     }
  248. X+ 
  249. X+     nbox = REGION_NUM_RECTS(prgnDst);
  250. X+     pbox = REGION_RECTS(prgnDst);
  251. X+     while (nbox--)
  252. X+     {
  253. X+     dstx = pbox->x1;
  254. X+     dsty = pbox->y1;
  255. X+     srcx = pptSrc->x;
  256. X+     srcy = pptSrc->y;
  257. X+     width = pbox->x2 - pbox->x1;
  258. X+     height = pbox->y2 - pbox->y1;
  259. X+     pbox++;
  260. X+     pptSrc++;
  261. X+     psrcLine = psrcBase + srcy * widthSrc + (srcx >> 5);
  262. X+     pdstLine = pdstBase + dsty * widthDst + dstx;
  263. X+     xoffSrc = srcx & 0x1f;
  264. X+     xoffDst = 0;
  265. X+ 
  266. X+     maskbits(dstx, width, startmask, endmask, nlMiddle);
  267. X+     leftShift = xoffSrc;
  268. X+     rightShift = 32 - leftShift;
  269. X+     if (rop == GXcopy && (planemask & PMSK) == PMSK)
  270. X+     {
  271. X+         while (height--)
  272. X+         {
  273. X+             psrc = psrcLine;
  274. X+             pdst = pdstLine;
  275. X+             psrcLine += widthSrc;
  276. X+             pdstLine += widthDst;
  277. X+             bits = *psrc++;
  278. X+             nl = nlMiddle;
  279. X+             while (nl >= 32)
  280. X+             {
  281. X+             int i = 32;
  282. X+             nl -= 32;
  283. X+             tmp = BitLeft(bits, leftShift);
  284. X+             bits = *psrc++;
  285. X+             if (rightShift != 32)
  286. X+                 tmp |= BitRight(bits, rightShift);
  287. X+ #if BITMAP_BIT_ORDER == MSBFirst
  288. X+             while (i--)
  289. X+             *pdst++ = (tmp & (1 << i)) ?
  290. X+                 cfb32Pixelsfg : cfb32Pixelsbg;
  291. X+ #else
  292. X+             while (i--)
  293. X+             *pdst++ = (tmp & (1 << (31 - i))) ?
  294. X+                 cfb32Pixelsfg : cfb32Pixelsbg;
  295. X+ #endif
  296. X+             }
  297. X+         if (nl)
  298. X+         {
  299. X+             int i = 31;
  300. X+             tmp = BitLeft(bits, leftShift);
  301. X+             if (rightShift != 32)
  302. X+             {
  303. X+             bits = *psrc++;
  304. X+             tmp |= BitRight(bits, rightShift);
  305. X+             }
  306. X+ #if BITMAP_BIT_ORDER == MSBFirst
  307. X+             while (nl--)
  308. X+             *pdst++ = (tmp & (1 << i--)) ?
  309. X+                 cfb32Pixelsfg : cfb32Pixelsbg;
  310. X+ #else
  311. X+             while (nl--)
  312. X+             *pdst++ = (tmp & (1 << (31 - i--))) ?
  313. X+                 cfb32Pixelsfg : cfb32Pixelsbg;
  314. X+ #endif
  315. X+         }
  316. X+         }
  317. X+     }
  318. X+     else
  319. X+     {
  320. X+         register unsigned int   src;
  321. X+ 
  322. X+         while (height--)
  323. X+         {
  324. X+             psrc = psrcLine;
  325. X+             pdst = pdstLine;
  326. X+             psrcLine += widthSrc;
  327. X+             pdstLine += widthDst;
  328. X+             bits = *psrc++;
  329. X+             nl = nlMiddle;
  330. X+         if (rop == GXcopy)
  331. X+         {
  332. X+                 while (nl >= 32)
  333. X+                 {
  334. X+                 int i = 32;
  335. X+                 nl -= 32;
  336. X+                 tmp = BitLeft(bits, leftShift);
  337. X+                 bits = *psrc++;
  338. X+                 if (rightShift != 32)
  339. X+                     tmp |= BitRight(bits, rightShift);
  340. X+                 while (i--)
  341. X+                 {
  342. X+ #if BITMAP_BIT_ORDER == MSBFirst
  343. X+                 if (tmp & (1 << i))
  344. X+                 src = cfb32Pixelsfg;
  345. X+ #else
  346. X+                 if (tmp & (1 << (31 - i)))
  347. X+                 src = cfb32Pixelsfg;
  348. X+ #endif
  349. X+                 else
  350. X+                 src = cfb32Pixelsbg;
  351. X+                 *pdst = *pdst & ~planemask | src;
  352. X+                     pdst++;
  353. X+                 }
  354. X+                 }
  355. X+         }
  356. X+         else
  357. X+         {
  358. X+                 while (nl >= 32)
  359. X+                 {
  360. X+                 int i = 32;
  361. X+                 nl -= 32;
  362. X+                 tmp = BitLeft(bits, leftShift);
  363. X+                 bits = *psrc++;
  364. X+                 if (rightShift != 32)
  365. X+                     tmp |= BitRight(bits, rightShift);
  366. X+                 while (i--)
  367. X+                 {
  368. X+ #if BITMAP_BIT_ORDER == MSBFirst
  369. X+                 if (tmp & (1 << i))
  370. X+                 src = cfb32Pixelsfg;
  371. X+ #else
  372. X+                 if (tmp & (1 << (32 - i)))
  373. X+                 src = cfb32Pixelsfg;
  374. X+ #endif
  375. X+                 else
  376. X+                 src = cfb32Pixelsbg;
  377. X+                     *pdst = *pdst & ~planemask |
  378. X+                         DoRop(rop, src, *pdst) & planemask;
  379. X+                     pdst++;
  380. X+                 }
  381. X+                 }
  382. X+         }
  383. X+             if (nl)
  384. X+             {
  385. X+             int i = 31;
  386. X+             tmp = BitLeft(bits, leftShift);
  387. X+             if (rightShift != 32)
  388. X+             {
  389. X+                 bits = *psrc++;
  390. X+                 tmp |= BitRight (bits, rightShift);
  391. X+             }
  392. X+             while (nl--)
  393. X+             {
  394. X+ #if BITMAP_BIT_ORDER == MSBFirst
  395. X+             if (tmp & (1 << i--))
  396. X+                 src = cfb32Pixelsfg;
  397. X+ #else
  398. X+             if (tmp & (1 << (32 - i--)))
  399. X+                 src = cfb32Pixelsfg;
  400. X+ #endif
  401. X+             else
  402. X+                 src = cfb32Pixelsbg;
  403. X+                 *pdst = *pdst & ~planemask |
  404. X+                     DoRop(rop, src, *pdst) & planemask;
  405. X+                 pdst++;
  406. X+             }
  407. X+             }
  408. X+         }
  409. X+     }
  410. X+     }
  411. X+ }
  412. X+ #endif
  413. X+ 
  414. X+ cfbCopyImagePlane (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask)
  415. X+     DrawablePtr pSrcDrawable;
  416. X+     DrawablePtr pDstDrawable;
  417. X+     int    rop;
  418. X+     unsigned long planemask;
  419. X+     RegionPtr prgnDst;
  420. X+     DDXPointPtr pptSrc;
  421. X+ {
  422. X+     copyPlaneBitPlane = planemask;
  423. X+     cfbCopyPlane (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
  424. X+               (unsigned long) ~0L);
  425. X+ }
  426. X+ 
  427. X  RegionPtr cfbCopyPlane(pSrcDrawable, pDstDrawable,
  428. X          pGC, srcx, srcy, width, height, dstx, dsty, bitPlane)
  429. X      DrawablePtr     pSrcDrawable;
  430. X***************
  431. X*** 1595,1600 ****
  432. X--- 1840,1866 ----
  433. X                   dstx, dsty, bitPlane);
  434. X      }
  435. X      return ret;
  436. X+ 
  437. X+ #elif (PPW == 1)
  438. X+     if (pSrcDrawable->depth == 1 && pDstDrawable->depth == 32)
  439. X+     {
  440. X+     if (bitPlane == 1)
  441. X+     {
  442. X+         cfb32Pixelsfg = pGC->fgPixel & pGC->planemask;
  443. X+         cfb32Pixelsbg = pGC->bgPixel & pGC->planemask;
  444. X+         doBitBlt = cfbCopyPlane1to32;
  445. X+         ret = cfbCopyArea (pSrcDrawable, pDstDrawable,
  446. X+                 pGC, srcx, srcy, width, height, dstx, dsty);
  447. X+         doBitBlt = cfbDoBitblt;
  448. X+     }
  449. X+     else
  450. X+         ret = miHandleExposures (pSrcDrawable, pDstDrawable,
  451. X+             pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
  452. X+     }
  453. X+     else
  454. X+     return miCopyPlane(pSrcDrawable, pDstDrawable,
  455. X+         pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
  456. X+ 
  457. X  #else
  458. X      return miCopyPlane (pSrcDrawable, pDstDrawable,
  459. X          pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
  460. Xdiff -arcN server/ddx/cfb/cfbbres.c cg8/ddx/cfb/cfbbres.c
  461. X*** server/ddx/cfb/cfbbres.c    Sun Sep 16 23:36:28 1990
  462. X--- cg8/ddx/cfb/cfbbres.c    Sun Sep 16 23:45:17 1990
  463. X***************
  464. X*** 182,188 ****
  465. X              addrl += nlwidth;
  466. X              e += e3;
  467. X          }
  468. X!         if (!bit)
  469. X          {
  470. X              bit = leftbit;
  471. X              addrl++;
  472. X--- 182,188 ----
  473. X              addrl += nlwidth;
  474. X              e += e3;
  475. X          }
  476. X! /*        if (!bit) */
  477. X          {
  478. X              bit = leftbit;
  479. X              addrl++;
  480. X***************
  481. X*** 202,208 ****
  482. X              addrl += nlwidth;
  483. X              e += e3;
  484. X          }
  485. X!         if (!bit)
  486. X          {
  487. X              bit = rightbit;
  488. X              addrl--;
  489. X--- 202,208 ----
  490. X              addrl += nlwidth;
  491. X              e += e3;
  492. X          }
  493. X! /*        if (!bit) */
  494. X          {
  495. X              bit = rightbit;
  496. X              addrl--;
  497. X***************
  498. X*** 222,228 ****
  499. X          if (e >= 0)
  500. X          {
  501. X              bit = SCRRIGHT(bit,1);
  502. X!             if (!bit)
  503. X              {
  504. X              bit = leftbit;
  505. X              addrl++;
  506. X--- 222,228 ----
  507. X          if (e >= 0)
  508. X          {
  509. X              bit = SCRRIGHT(bit,1);
  510. X! /*            if (!bit) */
  511. X              {
  512. X              bit = leftbit;
  513. X              addrl++;
  514. X***************
  515. X*** 242,248 ****
  516. X          if (e >= 0)
  517. X          {
  518. X              bit = SCRLEFT(bit,1);
  519. X!             if (!bit)
  520. X              {
  521. X              bit = rightbit;
  522. X              addrl--;
  523. X--- 242,248 ----
  524. X          if (e >= 0)
  525. X          {
  526. X              bit = SCRLEFT(bit,1);
  527. X! /*            if (!bit) */
  528. X              {
  529. X              bit = rightbit;
  530. X              addrl--;
  531. Xdiff -arcN server/ddx/cfb/cfbbresd.c cg8/ddx/cfb/cfbbresd.c
  532. X*** server/ddx/cfb/cfbbresd.c    Sun Sep 16 23:36:27 1990
  533. X--- cg8/ddx/cfb/cfbbresd.c    Sun Sep 16 23:45:17 1990
  534. X***************
  535. X*** 204,210 ****
  536. X                  addrl += yinc;
  537. X                  e += e3;
  538. X                  }
  539. X!                 if (!bit)
  540. X                  {
  541. X                  bit = leftbit;
  542. X                  addrl++;
  543. X--- 204,210 ----
  544. X                  addrl += yinc;
  545. X                  e += e3;
  546. X                  }
  547. X! /*                if (!bit) */
  548. X                  {
  549. X                  bit = leftbit;
  550. X                  addrl++;
  551. X***************
  552. X*** 228,234 ****
  553. X                  addrl += yinc;
  554. X                  e += e3;
  555. X                  }
  556. X!                 if (!bit)
  557. X                  {
  558. X                  bit = rightbit;
  559. X                  addrl--;
  560. X--- 228,234 ----
  561. X                  addrl += yinc;
  562. X                  e += e3;
  563. X                  }
  564. X! /*                if (!bit) */
  565. X                  {
  566. X                  bit = rightbit;
  567. X                  addrl--;
  568. X***************
  569. X*** 252,258 ****
  570. X                  if (e >= 0)
  571. X                  {
  572. X                  bit = SCRRIGHT(bit,1);
  573. X!                 if (!bit)
  574. X                   {
  575. X                  bit = leftbit;
  576. X                  addrl++;
  577. X--- 252,258 ----
  578. X                  if (e >= 0)
  579. X                  {
  580. X                  bit = SCRRIGHT(bit,1);
  581. X! /*                if (!bit) */
  582. X                   {
  583. X                  bit = leftbit;
  584. X                  addrl++;
  585. X***************
  586. X*** 276,282 ****
  587. X                  if (e >= 0)
  588. X                  {
  589. X                  bit = SCRLEFT(bit,1);
  590. X!                 if (!bit)
  591. X                   {
  592. X                  bit = rightbit;
  593. X                  addrl--;
  594. X--- 276,282 ----
  595. X                  if (e >= 0)
  596. X                  {
  597. X                  bit = SCRLEFT(bit,1);
  598. X! /*                if (!bit) */
  599. X                   {
  600. X                  bit = rightbit;
  601. X                  addrl--;
  602. Xdiff -arcN server/ddx/cfb/cfbgc.c cg8/ddx/cfb/cfbgc.c
  603. X*** server/ddx/cfb/cfbgc.c    Sun Sep 16 23:36:25 1990
  604. X--- cg8/ddx/cfb/cfbgc.c    Sun Sep 16 23:45:16 1990
  605. X***************
  606. X*** 693,699 ****
  607. X          if (pGC->alu == GXcopy &&
  608. X          ((pGC->planemask & PMSK) == PMSK))
  609. X          {
  610. X!         pGC->ops->PushPixels = cfbPushPixels8;
  611. X          pGC->ops->PolyFillArc = cfbPolyFillArcSolidCopy;
  612. X          }
  613. X          break;
  614. X--- 693,699 ----
  615. X          if (pGC->alu == GXcopy &&
  616. X          ((pGC->planemask & PMSK) == PMSK))
  617. X          {
  618. X!         pGC->ops->PushPixels = mfbPushPixels;
  619. X          pGC->ops->PolyFillArc = cfbPolyFillArcSolidCopy;
  620. X          }
  621. X          break;
  622. Xdiff -arcN server/ddx/cfb/cfbgetsp.c cg8/ddx/cfb/cfbgetsp.c
  623. X*** server/ddx/cfb/cfbgetsp.c    Sun Sep 16 23:36:26 1990
  624. X--- cg8/ddx/cfb/cfbgetsp.c    Sun Sep 16 23:45:17 1990
  625. X***************
  626. X*** 68,74 ****
  627. X      case 1:
  628. X          mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
  629. X          return;
  630. X!     case 8:
  631. X          break;
  632. X      default:
  633. X          FatalError("cfbGetSpans: invalid depth\n");
  634. X--- 68,74 ----
  635. X      case 1:
  636. X          mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
  637. X          return;
  638. X!     case PSZ:
  639. X          break;
  640. X      default:
  641. X          FatalError("cfbGetSpans: invalid depth\n");
  642. Xdiff -arcN server/ddx/cfb/cfbmskbits.c cg8/ddx/cfb/cfbmskbits.c
  643. X*** server/ddx/cfb/cfbmskbits.c    Sun Sep 16 23:36:24 1990
  644. X--- cg8/ddx/cfb/cfbmskbits.c    Sun Sep 16 23:45:16 1990
  645. X***************
  646. X*** 149,159 ****
  647. X  #if    (BITMAP_BIT_ORDER == MSBFirst)
  648. X  int cfbmask[] =
  649. X      {
  650. X!     0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF
  651. X      }; 
  652. X  int cfbrmask[] = 
  653. X      {
  654. X!     0x00FFFFFF, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFF00
  655. X      };
  656. X  #else    /* (BITMAP_BIT_ORDER == LSBFirst) */
  657. X  int cfbmask[] =
  658. X--- 149,159 ----
  659. X  #if    (BITMAP_BIT_ORDER == MSBFirst)
  660. X  int cfbmask[] =
  661. X      {
  662. X!     0xFFFFFFFF, 0x00FF0000, 0x0000FF00, 0x000000FF
  663. X      }; 
  664. X  int cfbrmask[] = 
  665. X      {
  666. X!     0x00000000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFF00
  667. X      };
  668. X  #else    /* (BITMAP_BIT_ORDER == LSBFirst) */
  669. X  int cfbmask[] =
  670. Xdiff -arcN server/ddx/cfb/cfbmskbits.h cg8/ddx/cfb/cfbmskbits.h
  671. X*** server/ddx/cfb/cfbmskbits.h    Sun Sep 16 23:36:25 1990
  672. X--- cg8/ddx/cfb/cfbmskbits.h    Sun Sep 16 23:45:16 1990
  673. X***************
  674. X*** 82,93 ****
  675. X   * ==========================================================================
  676. X   */
  677. X  
  678. X! #define PPW    4
  679. X! #define PLST    3
  680. X! #define PIM    0x03
  681. X! #define PWSH    2
  682. X! #define PSZ    8
  683. X! #define PMSK    0xFF
  684. X  
  685. X  /* the following notes use the following conventions:
  686. X  SCREEN LEFT                SCREEN RIGHT
  687. X--- 82,93 ----
  688. X   * ==========================================================================
  689. X   */
  690. X  
  691. X! #define PPW    1
  692. X! #define PLST    0
  693. X! #define PIM    0
  694. X! #define PWSH    0
  695. X! #define PSZ    32
  696. X! #define PMSK    0x00FFFFFF
  697. X  
  698. X  /* the following notes use the following conventions:
  699. X  SCREEN LEFT                SCREEN RIGHT
  700. X***************
  701. X*** 214,287 ****
  702. X  #define BitLeft(lw,n)    ((lw) >> (n))
  703. X  #endif    /* (BITMAP_BIT_ORDER == MSBFirst) */
  704. X  
  705. X! #define SCRLEFT(lw, n)    BitLeft (lw, (n) * PSZ)
  706. X! #define SCRRIGHT(lw, n)    BitRight(lw, (n) * PSZ)
  707. X  
  708. X  /*
  709. X   * Note that the shift direction is independent of the byte ordering of the 
  710. X   * machine.  The following is portable code.
  711. X   */
  712. X! #define PFILL(p) ( ((p)&PMSK)          | \
  713. X!            ((p)&PMSK) <<   PSZ | \
  714. X!            ((p)&PMSK) << 2*PSZ | \
  715. X!            ((p)&PMSK) << 3*PSZ )
  716. X! #define PFILL2(p, pf) { \
  717. X!     pf = (p) & PMSK; \
  718. X!     pf |= (pf << PSZ); \
  719. X!     pf |= (pf << 2*PSZ); \
  720. X! }
  721. X  
  722. X  
  723. X  #define maskbits(x, w, startmask, endmask, nlw) \
  724. X!     startmask = cfbstarttab[(x)&PIM]; \
  725. X!     endmask = cfbendtab[((x)+(w)) & PIM]; \
  726. X!     if (startmask) \
  727. X!     nlw = (((w) - (PPW - ((x)&PIM))) >> PWSH); \
  728. X!     else \
  729. X!     nlw = (w) >> PWSH;
  730. X  
  731. X  #define maskpartialbits(x, w, mask) \
  732. X!     mask = cfbstartpartial[(x) & PIM] & cfbendpartial[((x) + (w)) & PIM];
  733. X  
  734. X  #define mask32bits(x, w, startmask, endmask) \
  735. X!     startmask = cfbstarttab[(x)&PIM]; \
  736. X!     endmask = cfbendtab[((x)+(w)) & PIM];
  737. X  
  738. X  
  739. X  #define getbits(psrc, x, w, dst) \
  740. X! if ( ((x) + (w)) <= PPW) \
  741. X! { \
  742. X!     dst = SCRLEFT(*(psrc), (x)); \
  743. X! } \
  744. X! else \
  745. X! { \
  746. X!     int m; \
  747. X!     m = PPW-(x); \
  748. X!     dst = (SCRLEFT(*(psrc), (x)) & cfbendtab[m]) | \
  749. X!       (SCRRIGHT(*((psrc)+1), m) & cfbstarttab[m]); \
  750. X! }
  751. X  
  752. X  
  753. X  #define putbits(src, x, w, pdst, planemask) \
  754. X  if ( ((x)+(w)) <= PPW) \
  755. X! { \
  756. X!     unsigned long tmpmask; \
  757. X!     maskpartialbits((x), (w), tmpmask); \
  758. X!     tmpmask &= PFILL(planemask); \
  759. X!     *(pdst) = (*(pdst) & ~tmpmask) | (SCRRIGHT(src, x) & tmpmask); \
  760. X! } \
  761. X! else \
  762. X! { \
  763. X!     unsigned long m; \
  764. X!     unsigned long n; \
  765. X!     unsigned long pm = PFILL(planemask); \
  766. X!     m = PPW-(x); \
  767. X!     n = (w) - m; \
  768. X!     *(pdst) = (*(pdst) & (cfbendtab[x] | ~pm)) | \
  769. X!     (SCRRIGHT(src, x) & (cfbstarttab[x] & pm)); \
  770. X!     *((pdst)+1) = (*((pdst)+1) & (cfbstarttab[n] | ~pm)) | \
  771. X!     (SCRLEFT(src, m) & (cfbendtab[n] & pm)); \
  772. X! }
  773. X  #if defined(__GNUC__) && defined(mc68020)
  774. X  #undef getbits
  775. X  #define FASTGETBITS(psrc, x, w, dst) \
  776. X--- 214,250 ----
  777. X  #define BitLeft(lw,n)    ((lw) >> (n))
  778. X  #endif    /* (BITMAP_BIT_ORDER == MSBFirst) */
  779. X  
  780. X! #define SCRLEFT(lw, n)  (lw)
  781. X! #define SCRRIGHT(lw, n)    (lw)
  782. X  
  783. X  /*
  784. X   * Note that the shift direction is independent of the byte ordering of the 
  785. X   * machine.  The following is portable code.
  786. X   */
  787. X! #define PFILL(p) (p)
  788. X! #define PFILL2(p, pf) pf = p;
  789. X  
  790. X  
  791. X  #define maskbits(x, w, startmask, endmask, nlw) \
  792. X!     startmask = 0; \
  793. X!     endmask = 0; \
  794. X!     nlw = w;
  795. X  
  796. X  #define maskpartialbits(x, w, mask) \
  797. X!     mask = 0xFFFFFFFF;
  798. X  
  799. X  #define mask32bits(x, w, startmask, endmask) \
  800. X!     startmask = 0; \
  801. X!     endmask = 0;
  802. X  
  803. X  
  804. X  #define getbits(psrc, x, w, dst) \
  805. X!     dst = *(psrc);
  806. X  
  807. X  
  808. X  #define putbits(src, x, w, pdst, planemask) \
  809. X  if ( ((x)+(w)) <= PPW) \
  810. X!     *(pdst) = src;
  811. X  #if defined(__GNUC__) && defined(mc68020)
  812. X  #undef getbits
  813. X  #define FASTGETBITS(psrc, x, w, dst) \
  814. X***************
  815. X*** 318,350 ****
  816. X  #endif /* mc68020 */
  817. X  
  818. X  #define putbitsrop(src, x, w, pdst, planemask, rop) \
  819. X- if ( ((x)+(w)) <= PPW) \
  820. X  { \
  821. X!     unsigned long tmpmask; \
  822. X!     unsigned long t1, t2; \
  823. X!     maskpartialbits((x), (w), tmpmask); \
  824. X!     PFILL2(planemask, t1); \
  825. X!     tmpmask &= t1; \
  826. X!     t1 = SCRRIGHT((src), (x)); \
  827. X!     t2 = DoRop(rop, t1, *(pdst)); \
  828. X!     *(pdst) = (*(pdst) & ~tmpmask) | (t2 & tmpmask); \
  829. X! } \
  830. X! else \
  831. X! { \
  832. X!     unsigned long m; \
  833. X!     unsigned long n; \
  834. X!     unsigned long t1, t2; \
  835. X!     unsigned long pm; \
  836. X!     PFILL2(planemask, pm); \
  837. X!     m = PPW-(x); \
  838. X!     n = (w) - m; \
  839. X!     t1 = SCRRIGHT((src), (x)); \
  840. X!     t2 = DoRop(rop, t1, *(pdst)); \
  841. X!     *(pdst) = (*(pdst) & (cfbendtab[x] | ~pm)) | (t2 & (cfbstarttab[x] & pm));\
  842. X!     t1 = SCRLEFT((src), m); \
  843. X!     t2 = DoRop(rop, t1, *((pdst) + 1)); \
  844. X!     *((pdst)+1) = (*((pdst)+1) & (cfbstarttab[n] | ~pm)) | \
  845. X!     (t2 & (cfbendtab[n] & pm)); \
  846. X  }
  847. X  
  848. X  #if GETLEFTBITS_ALIGNMENT == 1
  849. X--- 281,290 ----
  850. X  #endif /* mc68020 */
  851. X  
  852. X  #define putbitsrop(src, x, w, pdst, planemask, rop) \
  853. X  { \
  854. X!     unsigned long t2; \
  855. X!     t2 = DoRop(rop, SCRRIGHT((src), (x)), *(pdst)); \
  856. X!     *(pdst) = (*(pdst) & ~planemask) | (t2 & planemask); \
  857. X  }
  858. X  
  859. X  #if GETLEFTBITS_ALIGNMENT == 1
  860. X***************
  861. X*** 409,435 ****
  862. X   */
  863. X  #if (BITMAP_BIT_ORDER == MSBFirst)
  864. X  #define getstipplepixels( psrcstip, x, w, ones, psrcpix, destpix ) \
  865. X! { \
  866. X!     unsigned int q; \
  867. X!     int m; \
  868. X!     if ((m = ((x) - ((PPW*PSZ)-4))) > 0) { \
  869. X!         q = (*(psrcstip)) << m; \
  870. X!     if ( (x)+(w) > (PPW*PSZ) ) \
  871. X!         q |= GET_VALID_BITS_FROM_LONG(*((psrcstip)+1)) >> ((PPW*PSZ)-m); \
  872. X!     } \
  873. X      else \
  874. X!         q = (*(psrcstip)) >> -m; \
  875. X!     q = QuartetBitsTable[(w)] & ((ones) ? q : ~q); \
  876. X!     *(destpix) = (*(psrcpix)) & QuartetPixelMaskTable[q]; \
  877. X! }
  878. X! #else /* BITMAP_BIT_ORDER == LSB */
  879. X  #define getstipplepixels( psrcstip, xt, w, ones, psrcpix, destpix ) \
  880. X! { \
  881. X!     unsigned int q; \
  882. X!     q = GET_VALID_BITS_FROM_LONG(*(psrcstip)) >> (xt); \
  883. X!     if ( ((xt)+(w)) > (PPW*PSZ) ) \
  884. X!         q |= (*((psrcstip)+1)) << ((PPW*PSZ)-(xt)); \
  885. X!     q = QuartetBitsTable[(w)] & ((ones) ? q : ~q); \
  886. X!     *(destpix) = (*(psrcpix)) & QuartetPixelMaskTable[q]; \
  887. X! }
  888. X  #endif
  889. X--- 349,362 ----
  890. X   */
  891. X  #if (BITMAP_BIT_ORDER == MSBFirst)
  892. X  #define getstipplepixels( psrcstip, x, w, ones, psrcpix, destpix ) \
  893. X!     if (*(psrcstip) & ((unsigned long)(1 << 31) >> (x))) \
  894. X!         *(destpix) = (ones) ? *(psrcpix) : 0; \
  895. X      else \
  896. X!         *(destpix) = (ones) ? 0 : *(psrcpix);
  897. X! #else
  898. X  #define getstipplepixels( psrcstip, xt, w, ones, psrcpix, destpix ) \
  899. X!     if (*(psrcstip) & (1 << (x))) \
  900. X!         *(destpix) = (ones) ? *(psrcpix) : 0; \
  901. X!     else \
  902. X!         *(destpix) = (ones) ? 0 : *(psrcpix);
  903. X  #endif
  904. Xdiff -arcN server/ddx/cfb/cfbscrinit.c cg8/ddx/cfb/cfbscrinit.c
  905. X*** server/ddx/cfb/cfbscrinit.c    Sun Sep 16 23:36:27 1990
  906. X--- cg8/ddx/cfb/cfbscrinit.c    Sun Sep 16 23:45:17 1990
  907. X***************
  908. X*** 61,66 ****
  909. X--- 61,67 ----
  910. X  
  911. X  static VisualRec visuals[] = {
  912. X  /* vid  class        bpRGB cmpE nplan rMask gMask bMask oRed oGreen oBlue */
  913. X+     0,  TrueColor,     8, 256, 32, 0xff, 0xff00, 0xff0000, 0, 8, 16,
  914. X  #ifndef STATIC_COLOR
  915. X      0,  PseudoColor, _BP,  1<<PSZ,   PSZ,  0,   0,   0,   0,   0,   0,
  916. X      0,  DirectColor, _BP, _CE,       PSZ,  _RM, _GM, _BM, _RS, _GS, _BS,
  917. X***************
  918. X*** 78,84 ****
  919. X  static DepthRec depths[] = {
  920. X  /* depth    numVid        vids */
  921. X      1,        0,        NULL,
  922. X!     8,        NUMVISUALS,    VIDs
  923. X  };
  924. X  
  925. X  #define NUMDEPTHS    ((sizeof depths)/(sizeof depths[0]))
  926. X--- 79,85 ----
  927. X  static DepthRec depths[] = {
  928. X  /* depth    numVid        vids */
  929. X      1,        0,        NULL,
  930. X!    32,        NUMVISUALS,    VIDs
  931. X  };
  932. X  
  933. X  #define NUMDEPTHS    ((sizeof depths)/(sizeof depths[0]))
  934. X***************
  935. X*** 140,146 ****
  936. X      pScreen->numDepths = NUMDEPTHS;
  937. X      pScreen->allowedDepths = depths;
  938. X  
  939. X!     pScreen->rootDepth = 8;
  940. X      pScreen->minInstalledCmaps = 1;
  941. X      pScreen->maxInstalledCmaps = 1;
  942. X      pScreen->backingStoreSupport = Always;
  943. X--- 141,147 ----
  944. X      pScreen->numDepths = NUMDEPTHS;
  945. X      pScreen->allowedDepths = depths;
  946. X  
  947. X!     pScreen->rootDepth = 32;
  948. X      pScreen->minInstalledCmaps = 1;
  949. X      pScreen->maxInstalledCmaps = 1;
  950. X      pScreen->backingStoreSupport = Always;
  951. X***************
  952. X*** 157,163 ****
  953. X      if (!pPixmap)
  954. X      return FALSE;
  955. X      pPixmap->drawable.type = DRAWABLE_PIXMAP;
  956. X!     pPixmap->drawable.depth = 8;
  957. X      pPixmap->drawable.pScreen = pScreen;
  958. X      pPixmap->drawable.serialNumber = 0;
  959. X      pPixmap->drawable.x = 0;
  960. X--- 158,164 ----
  961. X      if (!pPixmap)
  962. X      return FALSE;
  963. X      pPixmap->drawable.type = DRAWABLE_PIXMAP;
  964. X!     pPixmap->drawable.depth = 32;
  965. X      pPixmap->drawable.pScreen = pScreen;
  966. X      pPixmap->drawable.serialNumber = 0;
  967. X      pPixmap->drawable.x = 0;
  968. Xdiff -arcN server/ddx/cfb/cfbtegblt.c cg8/ddx/cfb/cfbtegblt.c
  969. X*** server/ddx/cfb/cfbtegblt.c    Sun Sep 16 23:36:26 1990
  970. X--- cg8/ddx/cfb/cfbtegblt.c    Tue Sep 25 21:45:20 1990
  971. X***************
  972. X*** 157,168 ****
  973. X  
  974. X          while (hTmp--)
  975. X          {
  976. X!         x = xpos;
  977. X          width = wtmp;
  978. X-              xtemp = 0;
  979. X  
  980. X          while (width > 0)
  981. X          {
  982. X              tmpx = x & PIM;
  983. X              w = min(width, PPW - tmpx);
  984. X              w = min(w, (32 - xtemp));
  985. X--- 157,181 ----
  986. X  
  987. X          while (hTmp--)
  988. X          {
  989. X!         register unsigned int *dst = pdst + xpos,
  990. X!                       glyphbits = *(unsigned int *)pglyph;
  991. X          width = wtmp;
  992. X  
  993. X+ #if (PPW == 1)
  994. X          while (width > 0)
  995. X          {
  996. X+ #if BITMAP_BIT_ORDER == MSBFirst
  997. X+             *dst++ = (glyphbits & 0x80000000) ? fgfill : bgfill;
  998. X+             glyphbits <<= 1;
  999. X+ #else BITMAP_BIT_ORDER == LSBFirst
  1000. X+             *dst++ = (glyphbits & 1) ? fgfill : bgfill;
  1001. X+             glyphbits >>= 1;
  1002. X+ #endif BITMAP_BIT_ORDER
  1003. X+             width--;
  1004. X+         }
  1005. X+ #else (PPW != 1)
  1006. X+         while (width > 0)
  1007. X+         {
  1008. X              tmpx = x & PIM;
  1009. X              w = min(width, PPW - tmpx);
  1010. X              w = min(w, (32 - xtemp));
  1011. X***************
  1012. X*** 180,185 ****
  1013. X--- 193,199 ----
  1014. X              xtemp += w;
  1015. X              width -= w;
  1016. X          }
  1017. X+ #endif PPW
  1018. X          pglyph += widthGlyph;
  1019. X                  pdst += widthDst;
  1020. X          }
  1021. Xdiff -arcN server/ddx/sun/Imakefile cg8/ddx/sun/Imakefile
  1022. X*** server/ddx/sun/Imakefile    Sun Sep 16 23:36:37 1990
  1023. X--- cg8/ddx/sun/Imakefile    Sun Sep 16 23:48:03 1990
  1024. X***************
  1025. X*** 8,18 ****
  1026. X      sunKbd.c \
  1027. X      sunMouse.c \
  1028. X      sunUtils.c \
  1029. X!     sunCG2C.c \
  1030. X!     sunCG2M.c \
  1031. X!     sunCG3C.c \
  1032. X!     sunCG4C.c \
  1033. X!     sunCG6C.c \
  1034. X      sunKeyMap.c
  1035. X  
  1036. X  SRCS =    $(SRCS1) kbd_mode.c constype.c 
  1037. X--- 8,14 ----
  1038. X      sunKbd.c \
  1039. X      sunMouse.c \
  1040. X      sunUtils.c \
  1041. X!     sunCG8C.c \
  1042. X      sunKeyMap.c
  1043. X  
  1044. X  SRCS =    $(SRCS1) kbd_mode.c constype.c 
  1045. X***************
  1046. X*** 26,36 ****
  1047. X      sunKbd.o \
  1048. X      sunMouse.o \
  1049. X      sunUtils.o \
  1050. X!     sunCG2C.o \
  1051. X!     sunCG2M.o \
  1052. X!     sunCG3C.o \
  1053. X!     sunCG4C.o \
  1054. X!     sunCG6C.o \
  1055. X      sunKeyMap.o
  1056. X  
  1057. X     INCLUDES = -I. -I../mfb -I../mi -I../../include -I$(INCLUDESRC)
  1058. X--- 22,28 ----
  1059. X      sunKbd.o \
  1060. X      sunMouse.o \
  1061. X      sunUtils.o \
  1062. X!     sunCG8C.o \
  1063. X      sunKeyMap.o
  1064. X  
  1065. X     INCLUDES = -I. -I../mfb -I../mi -I../../include -I$(INCLUDESRC)
  1066. Xdiff -arcN server/ddx/sun/sun.h cg8/ddx/sun/sun.h
  1067. X*** server/ddx/sun/sun.h    Sun Sep 16 23:36:38 1990
  1068. X--- cg8/ddx/sun/sun.h    Sun Sep 16 23:45:15 1990
  1069. X***************
  1070. X*** 196,202 ****
  1071. X      pointer           fbPriv;        /* Frame-buffer-dependent data */
  1072. X  } fbFd;
  1073. X  
  1074. X! extern Bool sunSupportsDepth8;
  1075. X  extern unsigned long sunGeneration;
  1076. X  
  1077. X  typedef struct _sunFbDataRec {
  1078. X--- 196,202 ----
  1079. X      pointer           fbPriv;        /* Frame-buffer-dependent data */
  1080. X  } fbFd;
  1081. X  
  1082. X! extern Bool sunSupportsDepth32;
  1083. X  extern unsigned long sunGeneration;
  1084. X  
  1085. X  typedef struct _sunFbDataRec {
  1086. Xdiff -arcN server/ddx/sun/sunCG8C.c cg8/ddx/sun/sunCG8C.c
  1087. X*** server/ddx/sun/sunCG8C.c    Mon Sep 17 01:11:00 1990
  1088. X--- cg8/ddx/sun/sunCG8C.c    Sun Sep 16 23:45:15 1990
  1089. X***************
  1090. X*** 3,8 ****
  1091. X--- 3,12 ----
  1092. X   *    Functions to support the sun CG8 board as a memory frame buffer.
  1093. X   */
  1094. X  
  1095. X+ /****************************************************************/
  1096. X+ /* Modified from sunCG4C.c for X11R4 by TAKAHASHI Naoto            */
  1097. X+ /****************************************************************/
  1098. X+ 
  1099. X  /************************************************************
  1100. X  Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
  1101. X  
  1102. X***************
  1103. X*** 47,53 ****
  1104. X  
  1105. X  /*-
  1106. X   * The cg8 frame buffer is divided into several pieces.
  1107. X!  *    1) an array of 8-bit pixels
  1108. X   *    2) a one-bit deep overlay plane
  1109. X   *    3) an enable plane
  1110. X   *    4) a colormap and status register
  1111. X--- 51,57 ----
  1112. X  
  1113. X  /*-
  1114. X   * The cg8 frame buffer is divided into several pieces.
  1115. X!  *    1) an array of 32-bit pixels
  1116. X   *    2) a one-bit deep overlay plane
  1117. X   *    3) an enable plane
  1118. X   *    4) a colormap and status register
  1119. X***************
  1120. X*** 60,71 ****
  1121. X  typedef struct cg8c {
  1122. X      u_char mpixel[128*1024];        /* bit-per-pixel memory */
  1123. X      u_char epixel[128*1024];        /* enable plane */
  1124. X!     u_char cpixel[CG8_HEIGHT][CG8_WIDTH];    /* byte-per-pixel memory */
  1125. X  } CG8C, CG8CRec, *CG8CPtr;
  1126. X  
  1127. X  #define CG8C_IMAGE(fb)        ((caddr_t)(&(fb)->cpixel))
  1128. X  #define CG8C_IMAGEOFF        ((off_t)0x0)
  1129. X! #define CG8C_IMAGELEN        (((CG8_HEIGHT*CG8_WIDTH + 8191)/8192)*8192)
  1130. X  #define    CG8C_MONO(fb)        ((caddr_t)(&(fb)->mpixel))
  1131. X  #define    CG8C_MONOLEN        (128*1024)
  1132. X  #define    CG8C_ENABLE(fb)        ((caddr_t)(&(fb)->epixel))
  1133. X--- 64,75 ----
  1134. X  typedef struct cg8c {
  1135. X      u_char mpixel[128*1024];        /* bit-per-pixel memory */
  1136. X      u_char epixel[128*1024];        /* enable plane */
  1137. X!     u_long cpixel[CG8_HEIGHT][CG8_WIDTH];    /* word-per-pixel memory */
  1138. X  } CG8C, CG8CRec, *CG8CPtr;
  1139. X  
  1140. X  #define CG8C_IMAGE(fb)        ((caddr_t)(&(fb)->cpixel))
  1141. X  #define CG8C_IMAGEOFF        ((off_t)0x0)
  1142. X! #define CG8C_IMAGELEN        (((4*CG8_HEIGHT*CG8_WIDTH + 8191)/8192)*8192)
  1143. X  #define    CG8C_MONO(fb)        ((caddr_t)(&(fb)->mpixel))
  1144. X  #define    CG8C_MONOLEN        (128*1024)
  1145. X  #define    CG8C_ENABLE(fb)        ((caddr_t)(&(fb)->epixel))
  1146. X***************
  1147. X*** 75,80 ****
  1148. X--- 79,86 ----
  1149. X  
  1150. X  static int  sunCG8CScreenIndex;
  1151. X  
  1152. X+ static u_char mbak[128*1024];            /* backup for mpixel */
  1153. X+ 
  1154. X  /* XXX - next line means only one CG8 - fix this */
  1155. X  static ColormapPtr sunCG8CInstalledMap;
  1156. X  
  1157. X***************
  1158. X*** 351,357 ****
  1159. X              sunFbs[index].info.fb_width,
  1160. X              sunFbs[index].info.fb_height,
  1161. X              monitorResolution, monitorResolution,
  1162. X!             sunFbs[index].info.fb_width))
  1163. X          return (FALSE);
  1164. X      
  1165. X      pScreen->SaveScreen = sunCG8CSaveScreen;
  1166. X--- 357,363 ----
  1167. X              sunFbs[index].info.fb_width,
  1168. X              sunFbs[index].info.fb_height,
  1169. X              monitorResolution, monitorResolution,
  1170. X!             sunFbs[index].info.fb_width * 4))
  1171. X          return (FALSE);
  1172. X      
  1173. X      pScreen->SaveScreen = sunCG8CSaveScreen;
  1174. X***************
  1175. X*** 385,404 ****
  1176. X      ScreenPtr  pScreen;
  1177. X      u_char     select;
  1178. X  {
  1179. X!     int index;
  1180. X!     register int    *j, *end;
  1181. X  
  1182. X      index = pScreen->myNum;
  1183. X      CG8Cfb = (CG8CPtr) sunFbs[index].fb;
  1184. X  
  1185. X!     j = (int *) CG8Cfb->epixel;
  1186. X!     end = j + (128 / sizeof (int)) * 1024;
  1187. X!     if (!select)                         
  1188. X!       while (j < end)
  1189. X      *j++ = 0;
  1190. X      else
  1191. X!       while (j < end)
  1192. X!     *j++ = ~0;
  1193. X  }
  1194. X  
  1195. X  /*-
  1196. X--- 391,422 ----
  1197. X      ScreenPtr  pScreen;
  1198. X      u_char     select;
  1199. X  {
  1200. X!     int index, mindex;
  1201. X!     register int  *i, *j, *k, *end;
  1202. X  
  1203. X      index = pScreen->myNum;
  1204. X+     mindex = index?0:1;
  1205. X      CG8Cfb = (CG8CPtr) sunFbs[index].fb;
  1206. X  
  1207. X!     i = (int *) CG8Cfb->epixel;
  1208. X!     j = (int *) CG8Cfb->mpixel;
  1209. X!     k = (int *) mbak;
  1210. X!     end = i + (128 / sizeof (int)) * 1024;
  1211. X!     if ( screenInfo.screens[mindex] )
  1212. X!       ((PixmapPtr)screenInfo.screens[mindex]
  1213. X!         ->devPrivate)->devPrivate.ptr 
  1214. X!         = (pointer)(!select?mbak:CG8Cfb->mpixel);
  1215. X!     if (!select)
  1216. X!       while (i < end) {
  1217. X!     *i++ = 0;
  1218. X!     *k++ = *j;
  1219. X      *j++ = 0;
  1220. X+       }
  1221. X      else
  1222. X!       while (i < end) {
  1223. X!     *i++ = ~0;
  1224. X!     *j++ = *k++;
  1225. X!       }
  1226. X  }
  1227. X  
  1228. X  /*-
  1229. X***************
  1230. X*** 426,432 ****
  1231. X      int         fd;
  1232. X      struct fbtype fbType;
  1233. X  
  1234. X!     if ((fd = sunOpenFrameBuffer(FBTYPE_SUN4COLOR, &fbType, index, fbNum,
  1235. X                   argc, argv)) < 0)
  1236. X      return FALSE;
  1237. X  
  1238. X--- 444,450 ----
  1239. X      int         fd;
  1240. X      struct fbtype fbType;
  1241. X  
  1242. X!     if ((fd = sunOpenFrameBuffer(FBTYPE_MEMCOLOR, &fbType, index, fbNum,
  1243. X                   argc, argv)) < 0)
  1244. X      return FALSE;
  1245. X  
  1246. X***************
  1247. X*** 459,465 ****
  1248. X      sunFbs[index].info = fbType;
  1249. X      sunFbs[index].fb = (pointer) CG8Cfb;
  1250. X      sunFbs[index].EnterLeave = sunCG8CSwitch;
  1251. X!     sunSupportsDepth8 = TRUE;
  1252. X      return TRUE;
  1253. X  }
  1254. X  
  1255. X--- 477,483 ----
  1256. X      sunFbs[index].info = fbType;
  1257. X      sunFbs[index].fb = (pointer) CG8Cfb;
  1258. X      sunFbs[index].EnterLeave = sunCG8CSwitch;
  1259. X!     sunSupportsDepth32 = TRUE;
  1260. X      return TRUE;
  1261. X  }
  1262. X  
  1263. X***************
  1264. X*** 480,486 ****
  1265. X      i = AddScreen(sunCG8CInit, argc, argv);
  1266. X      if (i >= 0)
  1267. X      {
  1268. X!     /* Now set the enable plane for screen 0 */
  1269. X      sunCG8CSwitch(pScreenInfo->screens[i], i != 0);
  1270. X      return TRUE;
  1271. X      }
  1272. X--- 498,505 ----
  1273. X      i = AddScreen(sunCG8CInit, argc, argv);
  1274. X      if (i >= 0)
  1275. X      {
  1276. X!     if ( !i )
  1277. X!         pScreenInfo->screens[1] = 0;
  1278. X      sunCG8CSwitch(pScreenInfo->screens[i], i != 0);
  1279. X      return TRUE;
  1280. X      }
  1281. Xdiff -arcN server/ddx/sun/sunInit.c cg8/ddx/sun/sunInit.c
  1282. X*** server/ddx/sun/sunInit.c    Sun Sep 16 23:36:40 1990
  1283. X--- cg8/ddx/sun/sunInit.c    Sun Sep 16 23:50:06 1990
  1284. X***************
  1285. X*** 53,73 ****
  1286. X  #include    "dix.h"
  1287. X  #include    "opaque.h"
  1288. X  #include    "mipointer.h"
  1289. X  
  1290. X  extern int sunMouseProc();
  1291. X  extern int sunKbdProc();
  1292. X  extern Bool sunBW2Probe(), sunBW2Create();
  1293. X! extern Bool sunCG2CProbe(), sunCG2CCreate();
  1294. X! extern Bool sunCG3CProbe(), sunCG3CCreate();
  1295. X! extern Bool sunCG4CProbe(), sunCG4CCreate();
  1296. X! #ifdef FBTYPE_SUNFAST_COLOR /* doesn't exist in sunos3.x */
  1297. X! extern Bool sunCG6CProbe(), sunCG6CCreate();
  1298. X! #endif
  1299. X  extern void ProcessInputEvents();
  1300. X  
  1301. X  extern void SetInputCheck();
  1302. X  extern char *strncpy();
  1303. X  extern GCPtr CreateScratchGC();
  1304. X  
  1305. X  #define    XDEVICE    "XDEVICE"
  1306. X  #define    PARENT    "WINDOW_GFX"
  1307. X--- 53,70 ----
  1308. X  #include    "dix.h"
  1309. X  #include    "opaque.h"
  1310. X  #include    "mipointer.h"
  1311. X+ #include    <pixrect/pixrect_hs.h>
  1312. X  
  1313. X  extern int sunMouseProc();
  1314. X  extern int sunKbdProc();
  1315. X  extern Bool sunBW2Probe(), sunBW2Create();
  1316. X! extern Bool sunCG8CProbe(), sunCG8CCreate();
  1317. X  extern void ProcessInputEvents();
  1318. X  
  1319. X  extern void SetInputCheck();
  1320. X  extern char *strncpy();
  1321. X  extern GCPtr CreateScratchGC();
  1322. X+ extern Pixrect *sun_pr_screen;
  1323. X  
  1324. X  #define    XDEVICE    "XDEVICE"
  1325. X  #define    PARENT    "WINDOW_GFX"
  1326. X***************
  1327. X*** 76,82 ****
  1328. X  static int autoRepeatHandlersInstalled;    /* FALSE each time InitOutput called */
  1329. X  
  1330. X  static Bool sunDevsProbed = FALSE;
  1331. X! Bool sunSupportsDepth8 = FALSE;
  1332. X  unsigned long sunGeneration = 0;
  1333. X  
  1334. X  
  1335. X--- 73,79 ----
  1336. X  static int autoRepeatHandlersInstalled;    /* FALSE each time InitOutput called */
  1337. X  
  1338. X  static Bool sunDevsProbed = FALSE;
  1339. X! Bool sunSupportsDepth32 = FALSE;
  1340. X  unsigned long sunGeneration = 0;
  1341. X  
  1342. X  
  1343. X***************
  1344. X*** 105,116 ****
  1345. X  
  1346. X  sunFbDataRec sunFbData[] = {
  1347. X      sunBW2Probe,      "/dev/bwtwo0",        sunBW2Create,
  1348. X!     sunCG2CProbe,      "/dev/cgtwo0",        sunCG2CCreate,
  1349. X!     sunCG3CProbe,      "/dev/cgthree0",    sunCG3CCreate,
  1350. X! #ifdef FBTYPE_SUNFAST_COLOR
  1351. X!     sunCG6CProbe,    "/dev/cgsix0",        sunCG6CCreate,
  1352. X! #endif
  1353. X!     sunCG4CProbe,      "/dev/cgfour0",        sunCG4CCreate,
  1354. X      sunBW2Probe,      "/dev/bwtwo0",        sunBW2Create,
  1355. X  };
  1356. X  
  1357. X--- 102,108 ----
  1358. X  
  1359. X  sunFbDataRec sunFbData[] = {
  1360. X      sunBW2Probe,      "/dev/bwtwo0",        sunBW2Create,
  1361. X!     sunCG8CProbe,      "/dev/cgeight0",    sunCG8CCreate,
  1362. X      sunBW2Probe,      "/dev/bwtwo0",        sunBW2Create,
  1363. X  };
  1364. X  
  1365. X***************
  1366. X*** 125,131 ****
  1367. X  
  1368. X  static PixmapFormatRec    formats[] = {
  1369. X      1, 1, BITMAP_SCANLINE_PAD,    /* 1-bit deep */
  1370. X!     8, 8, BITMAP_SCANLINE_PAD,    /* 8-bit deep */
  1371. X  };
  1372. X  #define NUMFORMATS    (sizeof formats)/(sizeof formats[0])
  1373. X  
  1374. X--- 117,123 ----
  1375. X  
  1376. X  static PixmapFormatRec    formats[] = {
  1377. X      1, 1, BITMAP_SCANLINE_PAD,    /* 1-bit deep */
  1378. X!    32,32, BITMAP_SCANLINE_PAD,    /*32-bit deep */
  1379. X  };
  1380. X  #define NUMFORMATS    (sizeof formats)/(sizeof formats[0])
  1381. X  
  1382. X***************
  1383. X*** 227,236 ****
  1384. X          sunFbData[dev].createProc = NULL;
  1385. X      }
  1386. X      sunDevsProbed = TRUE;
  1387. X      if (n == 0)
  1388. X          return;
  1389. X      }
  1390. X!     if (!sunSupportsDepth8)
  1391. X      pScreenInfo->numPixmapFormats--;
  1392. X      for (i = NUMSCREENS, dev = devStart; --i > 0; dev++) {
  1393. X      if (sunFbData[dev].createProc)
  1394. X--- 219,229 ----
  1395. X          sunFbData[dev].createProc = NULL;
  1396. X      }
  1397. X      sunDevsProbed = TRUE;
  1398. X+ 
  1399. X      if (n == 0)
  1400. X          return;
  1401. X      }
  1402. X!     if (!sunSupportsDepth32)
  1403. X      pScreenInfo->numPixmapFormats--;
  1404. X      for (i = NUMSCREENS, dev = devStart; --i > 0; dev++) {
  1405. X      if (sunFbData[dev].createProc)
  1406. X***************
  1407. X*** 681,686 ****
  1408. X--- 674,685 ----
  1409. X          (void) close(fd);
  1410. X          return (-1);
  1411. X      }
  1412. X+     }
  1413. X+ 
  1414. X+     if (name)
  1415. X+     {
  1416. X+     sun_pr_screen = pr_open(name);
  1417. X+     pr_set_plane_group(sun_pr_screen, PIXPG_24BIT_COLOR);
  1418. X      }
  1419. X  
  1420. X      if (name && strcmp (name, "/dev/fb") == 0) {
  1421. END_OF_FILE
  1422. if test 37110 -ne `wc -c <'cg8.diff'`; then
  1423.     echo shar: \"'cg8.diff'\" unpacked with wrong size!
  1424. fi
  1425. # end of 'cg8.diff'
  1426. fi
  1427. echo shar: End of shell archive.
  1428. exit 0
  1429.  
  1430. dan
  1431. ----------------------------------------------------
  1432. O'Reilly && Associates   argv@sun.com / argv@ora.com
  1433. Opinions expressed reflect those of the author only.
  1434.